\subsection{Model}
We have chosen to use the concrete table inheritance model as the base for our setup. The reason we chose this was that we use the tables as they are and make no joins to make new tables to display on the website. As can be seen on \cref{lst:CitiesInCountry} we simply make a call to the database's $city$ table and retrieve its content which we then add to an array we then return.

\begin{code}{lst:CitiesInCountry}{Function that finds all cities in a given country}
\begin{lstlisting}
function getAllCitiesInCountry($id)
    {
        $query = "SELECT * FROM city WHERE countryid = $id" or die("Error in the consult.." . mysqli_error($this->db));

        //execute the query.
        $result = $this->db->query($query);

        $cities = array();

        while($row = mysqli_fetch_array($result))
        {

            $city = new City($row["id"], $row["name"], $row["population"], $row["countryid"]);

            $cities[count($cities)] = $city;
        }
        return $cities;
    }

\end{lstlisting}
\end{code}